package com.rz.htk.rocketmq.consumer;

import com.rz.htk.order.task.OrderTask;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
@RocketMQMessageListener(topic = "push_track_to_yousu", consumerGroup = "htk-server-consumer")
public class PushTrackConsumer implements RocketMQListener<String> {
    private Logger log = LoggerFactory.getLogger("PushTrackConsumer");

    @Resource private OrderTask orderTask;

    public void onMessage(String message){
        log.info("push track received message： {}",message);
        orderTask.pushTrackToYouSu(message);
    }
}
